package com.nblog.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.jfinal.plugin.ehcache.CacheKit;
import com.nblog.cache.CacheName;
import com.nblog.model.Webinfo;

public class WebinfoService {
	public Map<String,Object> getWebInfo(){
		List<Webinfo> list=CacheKit.get(CacheName.webInfoCache, "all");
		if(list==null||list.size()==0){
			list=Webinfo.dao.find("select * from webinfo");
			CacheKit.put(CacheName.webInfoCache, "all", list);
		}
		Map<String,Object> webinfo=new HashMap<String,Object>();
		for(Webinfo info:list){
			webinfo.put(info.getKey(), info.getValue());
		}
		return webinfo;
	}
}
